
<%@page import="fu.abc.model.Account"%>
<%@page import="fu.abc.DAO.AccountDAO"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>Vnplace - System admin</title>
	<!-- CSS -->
	<link href="css/transdmin.css" rel="stylesheet" type="text/css" media="screen" />
	<link href="./systemAdmin/css/transdmin.css" rel="stylesheet" type="text/css" media="screen" />
	<!-- JavaScripts-->
	<script type="text/javascript" src="js/validateInput.js"></script>
	<script type="text/javascript" src="./systemAdmin/js/validateInput.js"></script>
	<style>
		body {
			font-size: 15px;
		}
		
		#header {
			height: 60px;
			width: max;
			background: #19A3A3;
			color: white;
			/* 		position: fixed; */
		}
		
		a.logout {
			list-style: none;
			font-size: 15px;
			float: right;
			padding-top: 22px;
			text-decoration: none;
			color: white;
			margin-right: 20px;
		}
		
		a.logout:hover {
			color: #E6E6B8;
			text-decoration: underline;
			font-size: 16px;
		}
		
		p.hello {
			float: right;
			font-size: 15px;
			margin-right: 30px;
			padding-top: 22px;
		}
		
		li.createacc {
			background: #B2E0E0;
		}
		input{
			height: 25px;
		}
		input.save{
			background: #19A3A3;
			border: thin;
			color: white;
			font-size: 1.1em;
		}
		input.cancel {
			background: #19A3A3;
			border: thin;
			color: white;
			font-size: 1.1em;
		}
		#show-success{
			border: 1px solid #6666CC;
			width: 500px;
			height: 50px;
			background: #D5FFCE;
			margin-left: 10px;
			margin-bottom: 10px;
			border-radius: 10px;
		}
		ul#ul-success li{
			float: left;
		}
		p.success{
			padding-top: 15px;
		}
	</style>
</head>

<body>
	<div id="wrapper">
		<!-- h1 tag stays for the logo, you can use the a tag for linking the index page -->
		<div id="header">
			<%
				String acc = (String)session.getAttribute("acc");
			%>
			<b><a href="logout.jsp" class="logout">Đăng xuất</a></b>
			<%
				if(acc==null){
						response.sendRedirect("/Vnplace/systemAdmin/login.jsp");
					}else{
						
			// 					response.sendRedirect("/Vnplace/systemAdmin/createAccount.jsp");
			%>
			<p class="hello">
				Chào, <b><%=acc%></b>
			</p>
			<%
				}
			%>
		</div>
		<!-- // #end mainNav -->

		<div id="containerHolder">
			<h1>Hệ thống quản lý</h1>
			<div id="container">
				<div id="sidebar">
					<ul class="sideNav">
						<li><a href="/Vnplace/systemAdmin/systemAdmin.jsp">Trang chủ</a></li>
						<li><a href="/Vnplace/systemAdmin/manageAccount.jsp">Quản lý tài khoản</a></li>
<!-- 						<li class="createacc"><a href="/Vnplace/systemAdmin/createAccount.jsp">Tạo tài khoản mới</a></li> -->
					</ul>
					<!-- // .sideNav -->
				</div>
				<!-- // #sidebar -->

				<!-- h2 stays for breadcrumbs -->

				<div id="main">
					<%
						int id = Integer.parseInt(request.getParameter("idacc"));
						AccountDAO manage = new AccountDAO();
					    Account a = manage.getAccountInfor(id);
					%>
					<form action="/Vnplace/EditAccount" class="jNice" method="post"
						onsubmit="return checkInput();" accept-charset="UTF-8">
				
						<fieldset>
							<legend>Chỉnh sửa tài khoản</legend>
							
							<%Object mess = request.getAttribute("message");
							  if(mess!=null){
							%>
							<div id="show-success">
									<ul id="ul-success">
										<li> <img src="content-editor/image/tich.png" alt="" width="40px" height="40px" style="margin-left: 10px;margin-top: 5px;"/> </li>
										<li><p class="success">
												<%=mess.toString() %>
										</p></li>
									</ul>
								</div>
							<%} %>
							
							<input type="hidden" name="id" size="15" value="<%=a.getIdAcc() %>" />
							<table>
								<tr>
									<td align="right" width="350px"><b>Sơ yếu lý lịch</b></td>
									<td><b>Thông tin</b></td>
								</tr>
								<tr>
									<td align="right">Họ và tên:</td>
									<td><input type="text" name="fullname" size="25"
										id="username" value="<%=a.getFullname() %>" /></td>
								</tr>
								<tr>
									<td align="right">Ngày Sinh:</td>
									<td><input type="text" name="dob" size="25" id="dob"
										value="<%=a.getDob() %>" placeholder="Nhập dạng 01/22/2014" />
									</td>
								</tr>
								<tr>
									<td align="right">Địa chỉ:</td>
									<td><input type="text" name="address" size="35"
										id="address" value="<%=a.getAddress() %>" /></td>
								</tr>

								<tr>
									<td align="right">Email:</td>
									<td><input type="text" name="email" size="30" id="email"
										value="<%=a.getEmail() %>" />
										<p class="p1" id="email_error"></p></td>
								</tr>
								<tr>
									<td align="right">Số Điện Thoại:</td>
									<td><input type="text" name="phone" size="20" id="phone"
										value="<%=a.getPhone() %>" /></td>
								</tr>
								<tr>
									<td align="right">Tài khoản:</td>
									<td><input type="text" disabled="disabled"
										value="<%=a.getUsername() %>" /></td>
								</tr>
								<tr>
									<td align="right">Mật khẩu:</td>
									<td><input type="password" name="password" size="25"
										id="password" value="<%=a.getPassword()%>"/>
										<p class="p1" id="password_error"></p></td>
								</tr>
								<tr>
									<td align="right">Xác nhận mật khẩu:</td>
									<td><input type="password" name="repass" size="25" id="repass"/>
										<p class="p1" id="repass_error"></p></td>
								</tr>
								<tr>
									<td align="right">Vai trò:</td>
									<td><select name="role">
											<option selected="selected">-------Chọn-------</option>
											<option value="Content Editor">Content Editor</option>
											<option value="System Admin">System Admin</option>

									</select></td>
								</tr>
								<tr>
									<td align="right"></td>
									<td>
										<input type="submit" name="Luu" value="Lưu" class="save" />
										<input type="button" name="Huy" value="Hủy" class="cancel"
										onclick="window.location='/Vnplace/systemAdmin/viewAccount.jsp?idAcc=<%=a.getIdAcc() %>'" /></td>
								</tr>
							</table>
						</fieldset>
					</form>
				</div>
				<!-- // #main -->

				<div class="clear"></div>
			</div>
			<!-- // #container -->
		</div>
		<!-- // #containerHolder -->
		<div id="footer">
			<p class="copyright">©Copyright 2014 VnPlace.vn</p>
		</div>
	</div>
	<!-- // #wrapper -->
</body>
</html>




